package com.opc.controller;

import com.opc.entity.Device;
import com.opc.entity.User;
import com.opc.service.DeviceService;
import com.opc.service.UserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author 作者
 * @since 2023-03-13
 */
@RestController
@RequestMapping("/user")
public class UserController {
    @Resource
    private UserService userService;

    @GetMapping("/uid")
    public User findUserById(@RequestParam(name = "id") Integer id) {
        User user = userService.getById(id);
        return user;
    }
}
